<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style>
      .box {
        width: 500px;
        height: 400px;
        border: 1px solid rebeccapurple;
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        align-content:center; 
      
      
       
      }
      .box1 {
        width: 100px;
        height: 100px;
        background-color: rebeccapurple;
        font-size: 28px;
        text-align: center;
        line-height: 100px;
        color: aliceblue;
      }
      .box2 {
        width: 100px;
        height: 100px;
        background-color: rgb(22, 182, 43);
        font-size: 28px;
        text-align: center;
        line-height: 100px;
        color: aliceblue;
      }
      .box3 {
        width: 100px;
        height: 100px;
        background-color: rgb(196, 28, 56);
        font-size: 28px;
        text-align: center;
        line-height: 100px;
        color: aliceblue;
      }
       .box4 {
        width: 100px;
        height: 100px;
        background-color: rgb(89, 81, 204);
        font-size: 28px;
        text-align: center;
        line-height: 100px;
        color: aliceblue;
      }
       .box5 {
        width: 100px;
        height: 100px;
        background-color: rgb(184, 79, 137);
        font-size: 28px;
        text-align: center;
        line-height: 100px;
        color: aliceblue;
      }
      .box6 {
        width: 100px;
        height: 100px;
        background-color: rgb(100, 211, 155);
        font-size: 28px;
        text-align: center;
        line-height: 100px;
        color: aliceblue;
      }
       .box7 {
        width: 100px;
        height: 100px;
        background-color: rgb(131, 182, 50);
        font-size: 28px;
        text-align: center;
        line-height: 100px;
        color: aliceblue;
      }
       .box8 {
        width: 100px;
        height: 100px;
        background-color: rgb(40, 164, 196);
        font-size: 28px;
        text-align: center;
        line-height: 100px;
        color: aliceblue;
      }
       .box9 {
        width: 100px;
        height: 100px;
        background-color: rgb(194, 161, 69);
        font-size: 28px;
        text-align: center;
        line-height: 100px;
        color: aliceblue;
      }
    </style>
  </head>
  <body>
    <div class="box">
      <div class="box1">1</div>
      <div class="box2">2</div>
      <div class="box3">3</div>
      <div class="box4">4</div>
      <div class="box5">5</div>
      <div class="box6">6</div>
       <div class="box7">7</div>
        <div class="box8">8</div>
         <div class="box9">9</div>
    </div>
  </body>
</html>
